package cn.tedu.hospital.hosppm.controller;

import cn.tedu.hospital.base.response.JsonResult;
import cn.tedu.hospital.hosppm.pojo.dto.HosppmQuery;
import cn.tedu.hospital.hosppm.pojo.vo.HosppmVO;
import cn.tedu.hospital.hosppm.service.HosppmService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/v1/hosppm/")
public class HosppmController {
    @Autowired
    private HosppmService hosppmService;
    @GetMapping("select")
    public JsonResult selectHosppm( HosppmQuery hosppmQuery){
        log.debug("开始处理【查询住院病人信息】的请求，参数：{}", hosppmQuery);
        List<HosppmVO> hosppmVOS = hosppmService.select(hosppmQuery);
        return JsonResult.ok(hosppmVOS);
    }
    @GetMapping("selectByDepartmentName")
    public JsonResult selectByDepartmentName(){
        log.debug("开始处理【查询科室名】的请求");
        List<HosppmVO> departmentName = hosppmService.selectByDepartmentName();
        return JsonResult.ok(departmentName);
    }
}
